/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Administrator
 */
import java.io.*;
import java.net.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class DBConnector {
    
    private String JDBC_DRIVER = "com.mysql.jdbc.Driver";
    private String DATABASE_URL = "jdbc:mysql://localhost:3306/test_ikc019?user=root&password=admin";
    private Connection conn;
    public DBConnector()
    {
        try
        {
            Class.forName(this.JDBC_DRIVER);
            
            
            this.conn = DriverManager.getConnection(this.DATABASE_URL);
        }
        catch(ClassNotFoundException e)
        {
            System.out.println("Fel: " + e);
        }
        catch(SQLException e)
        {
            System.out.println("Fel: " + e); 
        }
    }
    public Connection getConn()
    {
        return conn;
    }
}
